package com.ruoyi.cat.service.impl;

import java.util.Collections;
import java.util.List;

import com.ruoyi.cat.domain.CatPrizeDraw;
import com.ruoyi.cat.domain.DTO.DrawMyDTO;
import com.ruoyi.cat.mapper.CatPrizeDrawMapper;
import com.ruoyi.cat.service.ICatPrizeDrawService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 抽到的卡记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-30
 */
@Service
public class CatPrizeDrawServiceImpl implements ICatPrizeDrawService
{
    @Autowired
    private CatPrizeDrawMapper catPrizeDrawMapper;

    /**
     * 查询抽到的卡记录
     * 
     * @param id 抽到的卡记录主键
     * @return 抽到的卡记录
     */
    @Override
    public CatPrizeDraw selectCatPrizeDrawById(Long id)
    {
        return catPrizeDrawMapper.selectCatPrizeDrawById(id);
    }

    /**
     * 查询抽到的卡记录列表
     * 
     * @param catPrizeDraw 抽到的卡记录
     * @return 抽到的卡记录
     */
    @Override
    public List<CatPrizeDraw> selectCatPrizeDrawList(CatPrizeDraw catPrizeDraw)
    {
        return catPrizeDrawMapper.selectCatPrizeDrawList(catPrizeDraw);
    }

    /**
     * 新增抽到的卡记录
     * 
     * @param catPrizeDraw 抽到的卡记录
     * @return 结果
     */
    @Override
    public int insertCatPrizeDraw(CatPrizeDraw catPrizeDraw)
    {
        catPrizeDraw.setCreateTime(DateUtils.getNowDate());
        return catPrizeDrawMapper.insertCatPrizeDraw(catPrizeDraw);
    }

    /**
     * 修改抽到的卡记录
     * 
     * @param catPrizeDraw 抽到的卡记录
     * @return 结果
     */
    @Override
    public int updateCatPrizeDraw(CatPrizeDraw catPrizeDraw)
    {
        return catPrizeDrawMapper.updateCatPrizeDraw(catPrizeDraw);
    }

    /**
     * 批量删除抽到的卡记录
     * 
     * @param ids 需要删除的抽到的卡记录主键
     * @return 结果
     */
    @Override
    public int deleteCatPrizeDrawByIds(Long[] ids)
    {
        return catPrizeDrawMapper.deleteCatPrizeDrawByIds(ids);
    }

    /**
     * 删除抽到的卡记录信息
     * 
     * @param id 抽到的卡记录主键
     * @return 结果
     */
    @Override
    public int deleteCatPrizeDrawById(Long id)
    {
        return catPrizeDrawMapper.deleteCatPrizeDrawById(id);
    }

    @Override
    public List<CatPrizeDraw> selectCatPrizeData(CatPrizeDraw catPrizeDraw) {
        return catPrizeDrawMapper.selectCatPrizeData(catPrizeDraw);
    }

    @Override
    public List<CatPrizeDraw> selectCatPrize(CatPrizeDraw catPrizeDraw) {
        return catPrizeDrawMapper.selectCatPrize(catPrizeDraw);
    }

    @Override
    public List<DrawMyDTO> getDrawMyByUserId(CatPrizeDraw catPrizeDraw) {
        return catPrizeDrawMapper.getDrawMyByUserId(catPrizeDraw);
    }
}
